package com.uxhao.eduservice.controller.admin;

import com.uxhao.commonutils.R;
import com.uxhao.eduservice.entity.adminVo.DashboardVo;
import com.uxhao.eduservice.service.AdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * @author uxhao
 * @Description 管理端Dashboard面板
 * @date 2022/04/03/ 19:52:00
 */
@Api(tags={"管理端Dashboard面板"})
//@CrossOrigin
@RestController
@RequestMapping("/eduservice/dashboard")
public class DashboardController {
    @Autowired
    private AdminService adminService;

    @ApiOperation(value = "获取基本数量数据")
    @GetMapping("getBaseCount")
    public R getBaseCount(){
        DashboardVo dashboardVo = adminService.dashboardData();
        return R.ok().data("dashboardVo",dashboardVo);
    }

    @ApiOperation(value = "获取折线图数据")
    @GetMapping("getLineChart")
    public R getLineChart(){
        Map<String, Object> map = adminService.getLineChart();
        return R.ok().data(map);
    }

}
